﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Pahan.McuFusion.Common.ComponentModel;

namespace Pahan.McuFusion.Common
{
    [TypeConverter(typeof(ProgrammerInfoConverter))]
    [Serializable]
    public abstract class ProgrammerInfo : BaseInfo
    {
        /// <summary>
        /// Gets the list of the supported microcontrollers.
        /// </summary>
        [DisplayName("Supported Devices")]
        public abstract IList<DeviceInfo> SupportedMicrocontrollers
        {
            get;
        }

        /// <summary>
        /// Creates an instance of the programmer.
        /// </summary>
        /// <param name="mcu">Target microcontroller.</param>
        /// <param name="adapter">Target adapter.</param>
        /// <returns></returns>
        public abstract IProgrammer CreateProgrammer(DeviceInfo mcu, IHardwareAdapter adapter);

        /// <summary>
        /// Checks whethes the specified hardware adapter is supported by the programmer.
        /// </summary>
        public abstract bool Supports(HardwareAdapterInfo hardwareAdapter);
    }
}
